{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "开始测量...\n",
      "测量结束\n",
      "39\n"
     ]
    }
   ],
   "source": [
    "def measure():\n",
    "    \"\"\"\n",
    "    返回当前温度\n",
    "    :return:\n",
    "    \"\"\"\n",
    "    print(\"开始测量...\")\n",
    "    temp = 39\n",
    "    print(\"测量结束\")\n",
    "    return temp\n",
    "\n",
    "result = measure()\n",
    "print(result)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "开始测量...\n",
      "测量结束\n",
      "(39, 10)\n"
     ]
    }
   ],
   "source": [
    "def measure():\n",
    "    \"\"\"\n",
    "    返回当前温度\n",
    "    :return:\n",
    "    \"\"\"\n",
    "    print(\"开始测量...\")\n",
    "    temp = 39\n",
    "    wetness = 10\n",
    "    print(\"测量结束\")\n",
    "    # 函数返回元组，括号可以省略\n",
    "    return temp,wetness\n",
    "\n",
    "result = measure()\n",
    "print(result)"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n"
    }
   }
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}